Restore HVM_OP hypercall continuation (partial revert of ae20ccf)
authorGeorge Dunlap <george.dunlap@citrix.com>
Mon, 22 May 2017 10:38:31 +0000 (11:38 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 24 May 2017 16:15:34 +0000 (17:15 +0100)
commit7cc806d7f1d91dd4c4656f11226f043c749eb0ed
tree6343c46c3fbde2b44f92b19ee3e35cd838abd2d6
parent3fafdc28eb98dc1cb686379d83270516fc38049d
Restore HVM_OP hypercall continuation (partial revert of ae20ccf)

Commit ae20ccf removed the hypercall continuation logic from the end
of do_hvm_op(), claiming:

"This patch removes the need for handling HVMOP restarts, so that
infrastructure is removed."

That turns out to be false.  The removal of HVMOP_set_mem_type removed
the need to store a start iteration value in the hypercall
continuation, but a grep through hvm.c for ERESTART turns up at least
two places where do_hvm_op() may still need a hypercall continuation:

 * HVMOP_set_hvm_param can return -ERESTART when setting
HVM_PARAM_IDENT_PT in the event that it fails to acquire the domctl
lock

 * HVMOP_flush_tlbs can return -ERESTART if several vcpus call it at
   the same time

In both cases, a simple restart (with no stored iteration information)
is necessary.

Add a check for -ERESTART again, along with a comment at the top of
the function regarding the lack of decoding any information from the
op value.

Reported-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
Tested-by: Xudong Hao <xudong.hao@intel.com>
xen/arch/x86/hvm/hvm.c